from wade_python import *
import numpy as np
from flask import Flask,request,jsonify


app = Flask(__name__)

@app.route('/') # 用装饰器定义的超链接
@app.route('/index')
def index(): # 视图函数
    return "WaDE WEB"




@app.route('/WaDE',methods=['POST'])
def lift_kp():
    #### GET IMG Info, Save

    #### im_np : 255 np
    data = request.get_json()



    return "AAAAA"
    # im_np = np.array(data['im_np'])
    # #'task_type': task_type, 'logdir': logdir, 'mean_std_type': mean_std_type, 'subtask': subtask, 'test_num_keypoints': test_num_keypoints
    # task_type=data['task_type']
    # logdir=data['logdir']
    # mean_std_type=data['mean_std_type']
    # subtask=data['subtask']
    # test_num_keypoints=int(data['test_num_keypoints'])


    # global task_test_kp
    # kp_list = detect(task_test_kp, im_np,task_type=task_type,logdir=logdir,mean_std_type=mean_std_type,subtask=subtask,test_num_keypoints=test_num_keypoints)
    # kp_list_Convert=[kp.tolist() for kp in kp_list]

    # return jsonify(kp_list_Convert)




if __name__ == '__main__':

    app.run(host='0.0.0.0')